package com.niiwoo.civet.account.service.local;

import com.niiwoo.civet.account.dao.entity.AccountPerson;
import com.niiwoo.civet.account.dao.mapper.AccountPersonMapperExt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AccountPersonService {

    @Autowired
    AccountPersonMapperExt accountPersonMapper;

    public boolean update(AccountPerson person) {
        return accountPersonMapper.updateByPrimaryKeySelective(person) > 0;
    }

    public boolean save(AccountPerson person) {
        return accountPersonMapper.insertSelective(person) > 0;
    }

    public AccountPerson get(Long accountId) {
        return accountPersonMapper.selectByPrimaryKey(accountId);
    }

    public AccountPerson queryByUserIdAndOrgId(String userId,String orgId){
        return accountPersonMapper.selectByUserIdAndOrgId(userId,orgId);
    }
}
